<?php
/**
 * 定制
 *
 * @copyright  Copyright (c) 2015-2025 NcPHP Inc. (http://www.ncphp.com)
 * @license    http://www.ncphp.com
 * @link       http://www.ncphp.com
 * @author	   NcPHP Team
 * @since      File available since Release v1.1
 */
defined('InNcPHP') or exit('Access Invalid!');

class customizeModel extends Model{

    public $type = array('0'=>'私人订制', '1'=>'企业定制');
    public $status = array('0'=>'未处理', '1'=>'已处理');

	public function __construct(){
		parent::__construct('customize');
	}

    /**
     * 获取列表
     * @param array $condition
     * @param string $field
     * @param int $page
     * @param string $order
     * @return mixed
     */
    public function getCustomizeListPage($condition = array(), $field = '*', $page = 10, $order = 'addtime desc'){
        return $this->field($field)->where($condition)->page($page)->order($order)->select();
    }

    /**
     * 添加
     * @param array $param
     * @return mixed
     */
    public function addCustomize($param){
        return $this->insert($param);
    }

    /**
     * 查询
     * @param array $condition
     * @param string $field
     * @return mixed
     */
    public function getCustomizeInfo($condition = array(), $field = '*'){
        return $this->field($field)->where($condition)->find();
    }

    /**
     * 更新
     * @param array $condition
     * @param array $param
     * @return mixed
     */
    public function updateCustomize($condition, $param){
        return $this->where($condition)->update($param);
    }

    /**
     * 删除
     * @param array $condition
     * @return mixed
     */
    public function delCustomize($condition){
        return $this->where($condition)->delete();
    }
}
?>